﻿@model MvcApplication4.Models.Post

@{
    ViewBag.Title = "Create";
    Session.Add(MvcApplication4.Controllers.SaveVarsController.SessionThreadIdName, (long)ViewBag.ThreadId);
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Post in @ViewBag.ThreadName</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Text)
        </div>
            @Html.TextAreaFor(model => model.Text, new { Class = "editor-field_large" })
            @Html.ValidationMessageFor(model => model.Text)
            
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to Thread", "ReturnToThread", new { id = (long)ViewBag.ThreadId })
</div>
